<template>
  <div>
    操作日志
    <el-table :data="page.data" style="width: 100%">
      <el-table-column prop="create_time" label="时间"></el-table-column>
      <el-table-column prop="message" label="操作"></el-table-column>
    </el-table>
    <el-pagination hide-on-single-page
                   :current-page="page.page" :page-size="page.page_size" :total="page.total"
                   layout=" prev, pager, next">
    </el-pagination>
  </div>
</template>

<script>
import {LogApi} from "@/api/api";
import {getJson} from "@/api/http";

export default {
  name: 'LogComponent',
  data() {
    return {
      url: "",
      page: {
        page: 1,
        page_size: 10,
        data: [],
      },
      //分页
    }
  },
  methods: {
    async init() {
      let data = {
        page: this.currentPage,
        pageSize: this.pageSize,
      }
      let res = await getJson(LogApi + "/" + 0, data)
      if (res.code !== 1) {
        this.$message.error('服务器异常');
        return
      }
      this.page = res.data
      console.log(this.page)
    }
  },
  created() {
    this.init()
  },
}
</script>

<style scoped>

</style>